Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: handle on-fatalerror better #32207

Closed

Conversation

HarshithaKP
Copy link
Member

--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora [email protected]

Fixes: #31576
Refs: #29881

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Mar 11, 2020
@HarshithaKP HarshithaKP changed the title report: handle on-fatalerror better report: handle on-fatalerror better[WIP] Mar 11, 2020
src/node_report_module.cc Outdated Show resolved Hide resolved
@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch from ae976b0 to a0df730 Compare March 12, 2020 08:39
errors->push_back("--report-on-fatalerror option is valid only when "
"--experimental-report is set");
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one extra change I am doing than #29881, to fix the issue mentioned in #29881 (comment)

@HarshithaKP HarshithaKP changed the title report: handle on-fatalerror better[WIP] report: handle on-fatalerror better Mar 12, 2020
@gireeshpunathil
Copy link
Member

This PR complements #32242 (though there will be many conflicts to resolve) , to make it stable with the last known bug being addressed. Request reviews, so that it can land along side before v14 d-cut!

@nodejs-github-bot
Copy link
Collaborator

@@ -86,6 +86,11 @@ void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
return;
}

if (per_process::cli_options->report_on_fatalerror) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should omit this, as #32242 makes it unnecessary, as previously noted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjihrig, removed this block. PTAL.

@@ -706,6 +701,13 @@ PerProcessOptionsParser::PerProcessOptionsParser(
"print V8 command line options",
&PerProcessOptions::print_v8_help);

#ifdef NODE_REPORT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, #32242 will make the #ifdef NODE_REPORT unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed #ifdef NODE_REPORT.

helper.validate(report);
}));
const spawnSync = require('child_process').spawnSync;
let args = ['--experimental-report',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--experimental-report can be dropped due to #32242.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed --experimental-report from args list.

const report = reports[0];
helper.validate(report);

args = ['--max-old-space-size=20',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here. Something along the lines of // Verify that reports are not created on fatal error by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added suggested comment in test case. PTAL.

@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch 2 times, most recently from cc0c963 to 8d71449 Compare March 16, 2020 06:28
@HarshithaKP
Copy link
Member Author

In test/report/test-report-fatal-error.js, linter error saying common is assigned but not used, I couldn't find proper place to use it in test case.

@cjihrig
Copy link
Contributor

cjihrig commented Mar 16, 2020

In test/report/test-report-fatal-error.js, linter error saying common is assigned but not used, I couldn't find proper place to use it in test case.

Instead of const common = require('../common');, you can just do require('../common'); since you aren't using it. You have to require() it though because it has some side effects, and our linting setup checks for its presence.

@HarshithaKP
Copy link
Member Author

@cjihrig, thanks. Fixed the error with your suggestion.

Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me.

@nodejs-github-bot
Copy link
Collaborator

@sam-github
Copy link
Contributor

sam-github commented Mar 23, 2020

@HarshithaKP This looks pretty much ready to land, but it needs a trivial rebase before a final CI. Ping me when you've done it and I'll kick that off.

EDIT: Alternatively, give me permissions and I'll do it: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests

--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora [email protected]

Fixes: nodejs#31576
Refs: nodejs#29881
@HarshithaKP HarshithaKP force-pushed the diagnostic_report_fatal_error branch from 5e9fdd9 to 7dbc5de Compare March 24, 2020 06:45
@HarshithaKP
Copy link
Member Author

@sam-github, thanks. Rebased it. PTAL.

addaleax added a commit to addaleax/node that referenced this pull request Mar 28, 2020
sam-github added a commit to sam-github/node that referenced this pull request Mar 30, 2020
Follow on to nodejs#32207, 3 other options
are also not respected under situations that the isolate is not
available.
sam-github added a commit that referenced this pull request Mar 31, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 31, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
addaleax added a commit that referenced this pull request Apr 2, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
BethGriggs pushed a commit that referenced this pull request Apr 7, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Apr 12, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora [email protected]

PR-URL: nodejs#32207
Fixes: nodejs#31576
Refs: nodejs#29881
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
Follow on to nodejs#32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: nodejs#32497
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
Overlooked in 2fa74e3.

Refs: nodejs#32207

PR-URL: nodejs#32535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
--report-on-fatalerror was not honored properly, as there was no
way to check the value which was stored in the Environment pointer
which can be inaccessible under certain fatal error situations.

Move the flag out of Environment pointer so that this is doable.

Co-authored-by: Shobhit Chittora [email protected]

PR-URL: #32207
Fixes: #31576
Refs: #29881
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
Follow on to #32207, 3 other options
are also not respected under situations that the isolate is not
available.

PR-URL: #32497
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #32535
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
gireeshpunathil added a commit to gireeshpunathil/node that referenced this pull request Oct 19, 2020
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: nodejs#32207
PR-URL: nodejs#35654
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
BethGriggs pushed a commit that referenced this pull request Dec 8, 2020
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
targos pushed a commit that referenced this pull request Mar 3, 2021
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 6, 2021
The property `process.report.reportOnFatalError`
was deemed experimental, as it was not honored
under certain scenarios (for example out of memory
conditions). The report configuration were previously
stored on the `environment` structure which was not
available on these types of fatal error cases.

The referenced PR has addressed this case (sometime
back), and the property is working as intended.

Refs: #32207
PR-URL: #35654
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostic report on fatal error does not respect settings
7 participants